package com.example.jdshopdeail.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.jdshopdeail.R;
import com.example.jdshopdeail.bean.TestBean;
import com.example.jdshopdeail.util.GlideUtils;

import java.util.List;

/**
 * @author: njb
 * @date: 2020/3/26 0026 18:44
 * @desc: 卡片适配器
 */
public class CardAdapter extends BaseQuickAdapter<TestBean, BaseViewHolder> {

    public CardAdapter(@Nullable List<TestBean> data) {
        super(R.layout.item_card, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, TestBean item) {
        GlideUtils.loadImg(mContext, item.getUrl(), helper.getView(R.id.iv_avatar), R.drawable.img_avatar_01);
        helper.setText(R.id.tv_name,item.getName());
    }

}
